package com.masterclient.app.businessmodule.minemodule.redpack.adapter;

import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.masterclient.app.R;
import com.masterclient.app.modules.coupon.beans.RedPackedListBean;
import com.eoner.baselibrary.utils.Utils;

import butterknife.BindView;

/**
 * 作者：sean
 * 创建时间：2017/8/7 14:08
 * 功能说明：
 */

public class RedPackedFromAdapter extends BaseQuickAdapter<RedPackedListBean.DataBean.ShItemsBean, BaseViewHolder> {


    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.tv_time)
    TextView tvTime;
    @BindView(R.id.tv_price_num)
    TextView tvPriceNum;

    public RedPackedFromAdapter() {
        super(R.layout.item_red_packed_from);
    }

    @Override
    protected void convert(BaseViewHolder helper, RedPackedListBean.DataBean.ShItemsBean item) {
        helper.setText(R.id.tv_time, item.getSh_create_at());
        helper.setText(R.id.tv_title,item.getSh_type_reason());
        helper.setText(R.id.tv_price_num,"+"+ item.getSh_amount());
        Utils.setDin(helper.getView(R.id.tv_price_num),mContext);

        if(helper.getLayoutPosition() == getData().size()-1){
            helper.getView(R.id.v_line).setVisibility(View.INVISIBLE);
        }
    }
}
